package baitap_demo;

import java.util.Scanner;

abstract class sinhvien
{
	public String Hoten;
	public String Maso;
	public String Lop;
	public sinhvien(String Hoten,String Maso,String Lop)
	{
		this.Hoten =Hoten;
		this.Maso = Maso;
		this.Lop= Lop;
	}
	public void Nhap(){
		Scanner Nhap = new Scanner(System.in);
		System.out.println("Nhap ten");
		this.Hoten = Nhap.nextLine();
		
		System.out.println("Nhap Ma so: ");
		this.Maso= Nhap.nextLine();
		
	}
	abstract  float tinhdiem();
	public void In(){
		System.out.println("Ten :"+this.Hoten);
		System.out.println("Maso: "+this.Maso);
		System.out.println("Lop: "+this.Lop);
		System.out.println("Tong Diem: "+tinhdiem());
	}
}
class sinhviencaodang extends sinhvien{
	private float diemtrr;
	private float diemjava;
	private float diemcsdl;
	public sinhviencaodang (String Hoten,String Maso,String Lop,float diemtrr, float diemjava,float diemcsdl) {
		super(Hoten, Maso, Lop);
		this.diemcsdl = diemcsdl;
		this.diemjava = diemjava;
		this.diemtrr= diemtrr;
		}
	public void nhapsvcd(){
		Scanner Nhapa = new Scanner(System.in);
		super.Nhap();
		System.out.println("Diem toan rac roi");
		this.diemtrr = Nhapa.nextFloat();
		
		System.out.println("Diem Java: ");
		this.diemjava = Nhapa.nextFloat();
		System.out.println("Diem CSDL: ");
		this.diemcsdl = Nhapa.nextFloat();
	}
	float tinhdiem(){
		return(this.diemcsdl+this.diemjava+this.diemtrr)/3;
		
	}
	public void Insinhvien(){
		super.In();
	}
	
}



public class demobaitao {


}
